<template>
  <div class="compilation-main">
    <div class="channel-add-video" @click="openDialog">
      <div class="add-covers-meta">
        <span class="iconfont icon-plus-full create-covers-meta-span"></span>
        <span class="create-covers-meta-span">新建视频列表</span>
      </div>
    </div>
    <!--各个合集部分-->
    <div :class="['small-item-other',(index+1)%6==0?'small-item-six':'small-item-common']" v-for="(item,index) in list" :key="index">
      <div class="soon-dianzan-other">
        <img @click="jumpVideoItem(item)" class="common-cursor soon-dianzan-img" :src="require('/src/assets/img/picture.png')" alt="">
        <div class="video-num" @click="jumpVideoItem(item)">
          <span class="num-span">{{item.count}}</span>
          <span class="iconfont icon-shipinheji" style="font-size: 20px"></span>
        </div>
        <!--开始播放图标-->
        <div class="playall" @click="playAllVideo">
          <span class="iconfont icon-bofang1"></span>
        </div>
      </div>
      <!--合集名称-->
      <div class="video-title two-text-overflow">
        {{item.compilationName}}
      </div>
      <!--合集日期-->
      <div class="meta">
        {{item.date}}
      </div>
    </div>
  </div>
</template>

<script>
export default {
  /**视频合集列表盒子 块状分布**/
  name: "compilationVideoItem",
  props: {
    list: {
      type: Array,
      default: ()=>[]
    },
  },
  data(){
    return{
      watchlater:-1,
    }
  },
  methods:{
    // 跳转到合集里面
    jumpVideoItem(item){
      this.$emit('changeEnCo',item)
    },
    openDialog(){
      this.$emit('openDialog')
    },
    // 播放全部视频
    playAllVideo(){
      console.log('播放全部视频')
    }
  },

}
</script>

<style scoped>
.playall {
  position: absolute;
  right: 4px;
  bottom: 4px;
  color: #fff;
  background-color: rgba(0,0,0,.5);
  width: 24px;
  height: 24px;
  border-radius: 4px;
  text-align: center;
  cursor: pointer;
  display: flex;
}
.playall span{
  margin: auto;
  font-size: 10px;
}
.video-num{
  cursor: pointer;
  position: absolute;
  top: 0;
  right: 0;
  width: 70px;
  height: 100%;
  color: #e5e9ef;
  text-align: center;
  font-size: 12px;
  box-sizing: border-box;
  background-color: rgba(0,0,0,.5);
}
.num-span{
  margin-top: 38px;
  display: block;
  line-height: 20px;
  font-size: 18px;
  color: #fff;
  font-weight: 400;
}
.compilation-main{
  overflow: hidden;
  padding-top: 20px;
}
.channel-add-video:hover{
  border-color: #00a1d6;
}
.channel-add-video:hover span{
  color: #00a1d6;
}
.channel-add-video {
  position: relative;
  width: 190px;
  height: 119px;
  margin-top: 10px;
  background: #fff;
  border: 2px dashed #b8c0cc;
  border-radius: 4px;
  transition: border .2s ease;
  box-sizing: border-box;
  cursor: pointer;
  display: block;
  margin-right: 10px;
  float: left;
}
.add-covers-meta {
  position: absolute;
  top: 50%;
  width: 100%;
  transform: translateY(-50%);
}

.create-covers-meta-span {
  display: block;
  color: #999999;
  font-size: 16px;
  text-align: center;
}
.margin-left{
  margin-left: -10px;
}

.small-item-other {
  display: block;
  float: left;
  /*width: 208px;*/
  position: relative;
  margin: 0 0 3px;
}
.small-item-common{
  padding: 10px;
  width: 208px;
}
.small-item-six{
  padding: 10px 10px 10px 0;
  width: 198px;
}
.meta{
  font-size: 12px;color: #999999;margin: 5px 0;
}

.soon-dianzan-other{
  background: url('https://images.weserv.nl/?url=https://i0.hdslb.com/bfs/static/jinkela/space/asserts/video-placeholder.png') 50%;
  background-size: cover;
  width: 188px;height: 119px;position: relative;border-radius: 4px;overflow:hidden;
}
.soon-dianzan-img{
  width: 100%;height: 100%;object-fit: cover;
}

.video-title{
  font-size: 12px;overflow: hidden;margin: 5px 0;
}

.two-text-overflow{
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.common-cursor{
  cursor: pointer;
}
.common-hover:hover {
  color: #00a1d6;
}

</style>
